<!DOCTYPE HTML>
<html lang="zh-CN">


<head>
    <meta charset="utf-8">
    <meta name="keywords" content="在小型数据集上从头开始训练一个卷积神经网络, Hmm">
    <meta name="description" content="说到深度学习，不可避免得会提及业界有哪些优秀的框架，Keras神经网络框架便是其中之一，它是一个高级神经网络APl，用Python编写，能够在TensorFlow，CNTK或Theano之上运行。它的开发重点是实现快速实验。能够以最小的延迟从理念到结果是进行良好研究的关键。接下来我们将要讲的神经网络原理与梯度求解，Keras都已经对它们有了很好的封装，在后续的学习中，大家只要学会怎么去构建网络结构就没有什么问题了，其余的问题都由神经网络框架替我们去解决。">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0, user-scalable=no">
    <meta name="renderer" content="webkit|ie-stand|ie-comp">
    <meta name="mobile-web-app-capable" content="yes">
    <meta name="format-detection" content="telephone=no">
    <meta name="apple-mobile-web-app-capable" content="yes">
    <meta name="apple-mobile-web-app-status-bar-style" content="black-translucent">
    <meta name="referrer" content="no-referrer-when-downgrade">
    <!-- Global site tag (gtag.js) - Google Analytics -->


    
    <style>
        body{
            background-image: url(https://gitee.com/lyhcyt_admin/pic/raw/master/img/202204081828269.jpg);
            background-repeat:no-repeat;
            background-size: 100% 100%;
            background-attachment:fixed;
        }
    </style>


    <title>在小型数据集上从头开始训练一个卷积神经网络 | Hmm</title>
    <link rel="icon" type="image/png" href="/gitee.io/favicon.png">

    <link rel="stylesheet" type="text/css" href="/gitee.io/libs/awesome/css/all.min.css">
    <link rel="stylesheet" type="text/css" href="/gitee.io/libs/materialize/materialize.min.css">
    <link rel="stylesheet" type="text/css" href="/gitee.io/libs/aos/aos.css">
    <link rel="stylesheet" type="text/css" href="/gitee.io/libs/animate/animate.min.css">
    <link rel="stylesheet" type="text/css" href="/gitee.io/libs/lightGallery/css/lightgallery.min.css">
    <link rel="stylesheet" type="text/css" href="/gitee.io/css/matery.css">
    <link rel="stylesheet" type="text/css" href="/gitee.io/css/my.css">

    <script src="/gitee.io/libs/jquery/jquery-3.6.0.min.js"></script>

<meta name="generator" content="Hexo 6.3.0"><link rel="alternate" href="/gitee.io/atom.xml" title="Hmm" type="application/atom+xml">
<link rel="stylesheet" href="/gitee.io/css/prism-tomorrow.css" type="text/css">
<link rel="stylesheet" href="/gitee.io/css/prism-line-numbers.css" type="text/css"></head>


<body>
    <header class="navbar-fixed">
    <nav id="headNav" class="bg-color nav-transparent">
        <div id="navContainer" class="nav-wrapper container">
            <div class="brand-logo">
                <div>
                    <a href="/gitee.io/" class="waves-effect waves-light">
                        
                        <img src="./medias/loading1.gif" data-original="/gitee.io/medias/logo.png" class="logo-img" alt="LOGO">
                        
                        <span class="logo-span">Hmm</span>
                    </a>
                </div>
            </div>
            

<a href="#" data-target="mobile-nav" class="sidenav-trigger button-collapse"><i class="fas fa-bars"></i></a>
<ul class="right nav-menu">
  
  <li class="hide-on-med-and-down nav-item">
    
    <a href="/gitee.io/" class="waves-effect waves-light">
      
      <i class="fas fa-home" style="zoom: 0.6;"></i>
      
      <span>首页</span>
    </a>
    
  </li>
  
  <li class="hide-on-med-and-down nav-item">
    
    <a href="/gitee.io/tags" class="waves-effect waves-light">
      
      <i class="fas fa-tags" style="zoom: 0.6;"></i>
      
      <span>标签</span>
    </a>
    
  </li>
  
  <li class="hide-on-med-and-down nav-item">
    
    <a href="/gitee.io/categories" class="waves-effect waves-light">
      
      <i class="fas fa-bookmark" style="zoom: 0.6;"></i>
      
      <span>分类</span>
    </a>
    
  </li>
  
  <li class="hide-on-med-and-down nav-item">
    
    <a href="/gitee.io/archives" class="waves-effect waves-light">
      
      <i class="fas fa-archive" style="zoom: 0.6;"></i>
      
      <span>归档</span>
    </a>
    
  </li>
  
  <li class="hide-on-med-and-down nav-item">
    
    <a href="/gitee.io/about" class="waves-effect waves-light">
      
      <i class="fas fa-user-circle" style="zoom: 0.6;"></i>
      
      <span>关于</span>
    </a>
    
  </li>
  
  <li>
    <a href="#searchModal" class="modal-trigger waves-effect waves-light">
      <i id="searchIcon" class="fas fa-search" title="搜索" style="zoom: 0.85;"></i>
    </a>
  </li>
</ul>


<div id="mobile-nav" class="side-nav sidenav">

    <div class="mobile-head bg-color">
        
        <img src="./medias/loading1.gif" data-original="/gitee.io/medias/logo.png" class="logo-img circle responsive-img">
        
        <div class="logo-name">Hmm</div>
        <div class="logo-desc">
            
            Never really desperate, only the lost of the soul.
            
        </div>
    </div>

    <ul class="menu-list mobile-menu-list">
        
        <li class="m-nav-item">
	  
		<a href="/gitee.io/" class="waves-effect waves-light">
			
			    <i class="fa-fw fas fa-home"></i>
			
			首页
		</a>
          
        </li>
        
        <li class="m-nav-item">
	  
		<a href="/gitee.io/tags" class="waves-effect waves-light">
			
			    <i class="fa-fw fas fa-tags"></i>
			
			标签
		</a>
          
        </li>
        
        <li class="m-nav-item">
	  
		<a href="/gitee.io/categories" class="waves-effect waves-light">
			
			    <i class="fa-fw fas fa-bookmark"></i>
			
			分类
		</a>
          
        </li>
        
        <li class="m-nav-item">
	  
		<a href="/gitee.io/archives" class="waves-effect waves-light">
			
			    <i class="fa-fw fas fa-archive"></i>
			
			归档
		</a>
          
        </li>
        
        <li class="m-nav-item">
	  
		<a href="/gitee.io/about" class="waves-effect waves-light">
			
			    <i class="fa-fw fas fa-user-circle"></i>
			
			关于
		</a>
          
        </li>
        
        
        <li><div class="divider"></div></li>
        <li>
            <a href="https://gitee.com/lyhcyt_admin/gitee.io" class="waves-effect waves-light" target="_blank">
                <i class="fab fa-github-square fa-fw"></i>Fork Me
            </a>
        </li>
        
    </ul>
</div>


        </div>

        
            <style>
    .nav-transparent .github-corner {
        display: none !important;
    }

    .github-corner {
        position: absolute;
        z-index: 10;
        top: 0;
        right: 0;
        border: 0;
        transform: scale(1.1);
    }

    .github-corner svg {
        color: #0f9d58;
        fill: #fff;
        height: 64px;
        width: 64px;
    }

    .github-corner:hover .octo-arm {
        animation: a 0.56s ease-in-out;
    }

    .github-corner .octo-arm {
        animation: none;
    }

    @keyframes a {
        0%,
        to {
            transform: rotate(0);
        }
        20%,
        60% {
            transform: rotate(-25deg);
        }
        40%,
        80% {
            transform: rotate(10deg);
        }
    }
</style>

<a href="https://gitee.com/lyhcyt_admin/gitee.io" class="github-corner tooltipped hide-on-med-and-down" target="_blank"
   data-tooltip="Fork Me" data-position="left" data-delay="50">
    <svg viewBox="0 0 250 250" aria-hidden="true">
        <path d="M0,0 L115,115 L130,115 L142,142 L250,250 L250,0 Z"></path>
        <path d="M128.3,109.0 C113.8,99.7 119.0,89.6 119.0,89.6 C122.0,82.7 120.5,78.6 120.5,78.6 C119.2,72.0 123.4,76.3 123.4,76.3 C127.3,80.9 125.5,87.3 125.5,87.3 C122.9,97.6 130.6,101.9 134.4,103.2"
              fill="currentColor" style="transform-origin: 130px 106px;" class="octo-arm"></path>
        <path d="M115.0,115.0 C114.9,115.1 118.7,116.5 119.8,115.4 L133.7,101.6 C136.9,99.2 139.9,98.4 142.2,98.6 C133.8,88.0 127.5,74.4 143.8,58.0 C148.5,53.4 154.0,51.2 159.7,51.0 C160.3,49.4 163.2,43.6 171.4,40.1 C171.4,40.1 176.1,42.5 178.8,56.2 C183.1,58.6 187.2,61.8 190.9,65.4 C194.5,69.0 197.7,73.2 200.1,77.6 C213.8,80.2 216.3,84.9 216.3,84.9 C212.7,93.1 206.9,96.0 205.4,96.6 C205.1,102.4 203.0,107.8 198.3,112.5 C181.9,128.9 168.3,122.5 157.7,114.1 C157.9,116.9 156.7,120.9 152.7,124.9 L141.0,136.5 C139.8,137.7 141.6,141.9 141.8,141.8 Z"
              fill="currentColor" class="octo-body"></path>
    </svg>
</a>
        
    </nav>

</header>


    



<div class="bg-cover pd-header post-cover" style="background-image: url('https://cdn.jsdelivr.net/gh/LiU-YU-HANG/blogpic@main/test1/202303031442619.png')">
    <div class="container" style="right: 0px;left: 0px;">
        <div class="row">
            <div class="col s12 m12 l12">
                <div class="brand">
                    <h1 class="description center-align post-title">在小型数据集上从头开始训练一个卷积神经网络</h1>
                </div>
            </div>
        </div>
    </div>
</div>




<main class="post-container content">

    
    <link rel="stylesheet" href="/gitee.io/libs/tocbot/tocbot.css">
<style>
    #articleContent h1::before,
    #articleContent h2::before,
    #articleContent h3::before,
    #articleContent h4::before,
    #articleContent h5::before,
    #articleContent h6::before {
        display: block;
        content: " ";
        height: 100px;
        margin-top: -100px;
        visibility: hidden;
    }

    #articleContent :focus {
        outline: none;
    }

    .toc-fixed {
        position: fixed;
        top: 64px;
    }

    .toc-widget {
        width: 345px;
        padding-left: 20px;
    }

    .toc-widget .toc-title {
        padding: 35px 0 15px 17px;
        font-size: 1.5rem;
        font-weight: bold;
        line-height: 1.5rem;
    }

    .toc-widget ol {
        padding: 0;
        list-style: none;
    }

    #toc-content {
        padding-bottom: 30px;
        overflow: auto;
    }

    #toc-content ol {
        padding-left: 10px;
    }

    #toc-content ol li {
        padding-left: 10px;
    }

    #toc-content .toc-link:hover {
        color: #42b983;
        font-weight: 700;
        text-decoration: underline;
    }

    #toc-content .toc-link::before {
        background-color: transparent;
        max-height: 25px;

        position: absolute;
        right: 23.5vw;
        display: block;
    }

    #toc-content .is-active-link {
        color: #42b983;
    }

    #floating-toc-btn {
        position: fixed;
        right: 15px;
        bottom: 76px;
        padding-top: 15px;
        margin-bottom: 0;
        z-index: 998;
    }

    #floating-toc-btn .btn-floating {
        width: 48px;
        height: 48px;
    }

    #floating-toc-btn .btn-floating i {
        line-height: 48px;
        font-size: 1.4rem;
    }
</style>
<div class="row">
    <div id="main-content" class="col s12 m12 l9">
        <!-- 文章内容详情 -->
<div id="artDetail">
    <div class="card">
        <div class="card-content article-info">
            <div class="row tag-cate">
                <div class="col s7">
                    
                    <div class="article-tag">
                        
                            <a href="/gitee.io/tags/keras/">
                                <span class="chip bg-color">keras</span>
                            </a>
                        
                            <a href="/gitee.io/tags/python/">
                                <span class="chip bg-color">python</span>
                            </a>
                        
                    </div>
                    
                </div>
                <div class="col s5 right-align">
                    
                    <div class="post-cate">
                        <i class="fas fa-bookmark fa-fw icon-category"></i>
                        
                            <a href="/gitee.io/categories/keras%E5%BF%AB%E9%80%9F%E6%90%AD%E5%BB%BA%E7%A5%9E%E7%BB%8F%E7%BD%91%E7%BB%9C/" class="post-category">
                                keras快速搭建神经网络
                            </a>
                        
                    </div>
                    
                </div>
            </div>

            <div class="post-info">
                
                <div class="post-date info-break-policy">
                    <i class="far fa-calendar-minus fa-fw"></i>发布日期:&nbsp;&nbsp;
                    2022-04-05
                </div>
                

                

                
                <div class="info-break-policy">
                    <i class="far fa-file-word fa-fw"></i>文章字数:&nbsp;&nbsp;
                    9.7k
                </div>
                

                

                
            </div>
        </div>
        <hr class="clearfix">

        
        <!-- 是否加载使用自带的 prismjs. -->
        <link rel="stylesheet" href="/gitee.io/libs/prism/prism.css">
        

        

        <div class="card-content article-card-content">
            <div id="articleContent">
                <h2 id="在小型数据集上从头开始训练一个卷积神经网络">在小型数据集上从头开始训练一个卷积神经网络</h2>
<p>猫狗图像分类，数据集中包含4000张猫和狗的图像（2000张猫的图像，2000张狗的图像）。将1000张用于验证，1000张用于测试。<br>
这是一个很少的数据，如果不做正则化会得到71%的训练精度，这里会用到数据增强（data augmentation），它在计算机视觉领域是一种非常强大的降低过拟合的方法。使用之后网络精度将提升到82%。</p>
<h2 id="一、深度学习与小数据问题的相关性">一、深度学习与小数据问题的相关性</h2>
<p>不一定</p>
<h2 id="二、下载数据">二、下载数据</h2>
<p>猫狗分类的数据集不包含在Keras中。它有Kaggle在2013年末公开并作为一项计算机视觉竞赛的一部分，当时卷积神经网络还不是主流算法.</p>
<pre class="line-numbers language-python" data-language="python"><code class="language-python"># 代码 5-4 将图像复制到训练、验证和测试的目录
import os, shutil
# 原始数据集解压目录的路径
original_dataset_dir &#x3D; &#39;D:\kaggle_original_data&#39;<span aria-hidden="true" class="line-numbers-rows"><span></span><span></span><span></span><span></span></span></code></pre>
<pre class="line-numbers language-python" data-language="python"><code class="language-python"># 保存较小数据集的目录
base_dir &#x3D; &#39;D:\cats_and_dogs_small&#39;
os.mkdir(base_dir)<span aria-hidden="true" class="line-numbers-rows"><span></span><span></span><span></span></span></code></pre>
<pre class="line-numbers language-python" data-language="python"><code class="language-python"># 分别对应划分后的训练、验证和测试目录
train_dir &#x3D; os.path.join(base_dir, &#39;train&#39;)
os.mkdir(train_dir)
validation_dir &#x3D; os.path.join(base_dir, &#39;validation&#39;)
os.mkdir(validation_dir)
test_dir &#x3D; os.path.join(base_dir, &#39;test&#39;)
os.mkdir(test_dir)<span aria-hidden="true" class="line-numbers-rows"><span></span><span></span><span></span><span></span><span></span><span></span><span></span></span></code></pre>
<h4 id="训练集图像目录">训练集图像目录</h4>
<pre class="line-numbers language-python" data-language="python"><code class="language-python"># 猫的训练图像目录
train_cats_dir &#x3D; os.path.join(train_dir, &#39;cats&#39;)
os.mkdir(train_cats_dir)
# 狗的训练图像目录
train_dogs_dir &#x3D; os.path.join(train_dir, &#39;dogs&#39;)
os.mkdir(train_dogs_dir)<span aria-hidden="true" class="line-numbers-rows"><span></span><span></span><span></span><span></span><span></span><span></span></span></code></pre>
<h4 id="验证集图像目录">验证集图像目录</h4>
<pre class="line-numbers language-python" data-language="python"><code class="language-python"># 猫
validation_cats_dir &#x3D; os.path.join(validation_dir, &#39;cats&#39;)
os.mkdir(validation_cats_dir)
# 狗
validation_dogs_dir &#x3D; os.path.join(validation_dir, &#39;dogs&#39;)
os.mkdir(validation_dogs_dir)<span aria-hidden="true" class="line-numbers-rows"><span></span><span></span><span></span><span></span><span></span><span></span></span></code></pre>
<h4 id="测试集图像目录">测试集图像目录</h4>
<pre class="line-numbers language-python" data-language="python"><code class="language-python"># 猫
test_cats_dir &#x3D; os.path.join(test_dir, &#39;cats&#39;)
os.mkdir(test_cats_dir)
# 狗
test_dogs_dir &#x3D; os.path.join(test_dir, &#39;dogs&#39;)
os.mkdir(test_dogs_dir)<span aria-hidden="true" class="line-numbers-rows"><span></span><span></span><span></span><span></span><span></span><span></span></span></code></pre>
<h4 id="将前1000张猫的图像复制-到tain-cats-dir">将前1000张猫的图像复制,到tain_cats_dir</h4>
<pre class="line-numbers language-python" data-language="python"><code class="language-python">fnames &#x3D; [&#39;cat.&#123;&#125;.jpg&#39;.format(i) for i in range(1000)]
for fname in fnames:
    src &#x3D; os.path.join(original_dataset_dir, fname)
    dst &#x3D; os.path.join(train_cats_dir, fname)
    shutil.copyfile(src, dst)<span aria-hidden="true" class="line-numbers-rows"><span></span><span></span><span></span><span></span><span></span></span></code></pre>
<h4 id="将500张猫的图像复制到validation-cats-dir">将500张猫的图像复制到validation_cats_dir</h4>
<pre class="line-numbers language-python" data-language="python"><code class="language-python">fnames &#x3D; [&#39;cat.&#123;&#125;.jpg&#39;.format(i) for i in range(1000, 1500)]
for fname in fnames:
    src &#x3D; os.path.join(original_dataset_dir, fname)
    dst &#x3D; os.path.join(validation_cats_dir, fname)
    shutil.copyfile(src, dst)<span aria-hidden="true" class="line-numbers-rows"><span></span><span></span><span></span><span></span><span></span></span></code></pre>
<h4 id="将500张猫的图像复制到test-cats-dir">将500张猫的图像复制到test_cats_dir</h4>
<pre class="line-numbers language-python" data-language="python"><code class="language-python">fnames &#x3D; [&#39;cat.&#123;&#125;.jpg&#39;.format(i) for i in range(1500, 2000)]
for fname in fnames:
    src &#x3D; os.path.join(original_dataset_dir, fname)
    dst &#x3D; os.path.join(test_cats_dir, fname)
    shutil.copyfile(src, dst)<span aria-hidden="true" class="line-numbers-rows"><span></span><span></span><span></span><span></span><span></span></span></code></pre>
<pre class="line-numbers language-python" data-language="python"><code class="language-python"># 准备狗和猫的训练集、测试集、验证集
fnames &#x3D; [&#39;dog.&#123;&#125;.jpg&#39;.format(i) for i in range(1000)]
for fname in fnames:
    src &#x3D; os.path.join(original_dataset_dir, fname)
    dst &#x3D; os.path.join(train_dogs_dir, fname)
    shutil.copyfile(src, dst)

fnames &#x3D; [&#39;dog.&#123;&#125;.jpg&#39;.format(i) for i in range(1000, 1500)]
for fname in fnames:
    src &#x3D; os.path.join(original_dataset_dir, fname)
    dst &#x3D; os.path.join(validation_dogs_dir, fname)
    shutil.copyfile(src, dst)
    
fnames &#x3D; [&#39;dog.&#123;&#125;.jpg&#39;.format(i) for i in range(1500, 2000)]
for fname in fnames:
    src &#x3D; os.path.join(original_dataset_dir, fname)
    dst &#x3D; os.path.join(test_dogs_dir, fname)
    shutil.copyfile(src, dst)<span aria-hidden="true" class="line-numbers-rows"><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span></span></code></pre>
<p>我们确有2000张训练图像、1000张验证图像和1000张测试图像。每个分组中两个类别的样本数相同，这是一个平衡的二分类问题，分类精度可作为衡量成功的指标。</p>
<h2 id="三、构建网络">三、构建网络</h2>
<p>这里处理的是更大更复杂的问题，你需要相应的增大网络，即再增加一个Conv2D+MaxPooling2D的组合。这既可以增大网络容量，也可以进一步特征图的尺寸，使其在连接Flatten层时尺寸不会太大。本例中初始输入的尺寸为150<em>150(有些随意选择)，所以在Flatten层之前的特征图大小为7</em>7。<br>
因为这是一个二分类的问题，所以网络最后一层使用sigmoid激活的单一单元。</p>
<pre class="line-numbers language-python" data-language="python"><code class="language-python"># 代码5-5 将猫狗分类的小型卷积网络实例化
from keras import layers
from keras import models

model &#x3D; models.Sequential()
model.add(layers.Conv2D(32, (3, 3), activation&#x3D;&#39;relu&#39;,
                        input_shape&#x3D;(150, 150, 3)))
model.add(layers.MaxPooling2D(2, 2))
model.add(layers.Conv2D(64, (3, 3), activation&#x3D;&#39;relu&#39;))
model.add(layers.MaxPooling2D(2, 2))
model.add(layers.Conv2D(128, (3, 3)))
model.add(layers.MaxPooling2D(2, 2))
model.add(layers.Conv2D(128, (3, 3)))
model.add(layers.MaxPooling2D(2, 2))
model.add(layers.Flatten())
model.add(layers.Dense(512, activation&#x3D;&#39;relu&#39;))
model.add(layers.Dense(1, activation&#x3D;&#39;sigmoid&#39;))<span aria-hidden="true" class="line-numbers-rows"><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span></span></code></pre>
<pre class="line-numbers language-bash" data-language="bash"><code class="language-bash">Using TensorFlow backend.<span aria-hidden="true" class="line-numbers-rows"><span></span></span></code></pre>
<pre class="line-numbers language-python" data-language="python"><code class="language-python">model.summary()<span aria-hidden="true" class="line-numbers-rows"><span></span></span></code></pre>
<pre class="line-numbers language-bash" data-language="bash"><code class="language-bash">    Model: &quot;sequential_1&quot;
    _________________________________________________________________
    Layer (type)                 Output Shape              Param #   
    &#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;
    conv2d_1 (Conv2D)            (None, 148, 148, 32)      896       
    _________________________________________________________________
    max_pooling2d_1 (MaxPooling2 (None, 74, 74, 32)        0         
    _________________________________________________________________
    conv2d_2 (Conv2D)            (None, 72, 72, 64)        18496     
    _________________________________________________________________
    max_pooling2d_2 (MaxPooling2 (None, 36, 36, 64)        0         
    _________________________________________________________________
    conv2d_3 (Conv2D)            (None, 34, 34, 128)       73856     
    _________________________________________________________________
    max_pooling2d_3 (MaxPooling2 (None, 17, 17, 128)       0         
    _________________________________________________________________
    conv2d_4 (Conv2D)            (None, 15, 15, 128)       147584    
    _________________________________________________________________
    max_pooling2d_4 (MaxPooling2 (None, 7, 7, 128)         0         
    _________________________________________________________________
    flatten_1 (Flatten)          (None, 6272)              0         
    _________________________________________________________________
    dense_1 (Dense)              (None, 512)               3211776   
    _________________________________________________________________
    dense_2 (Dense)              (None, 1)                 513       
    &#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;
    Total params: 3,453,121
    Trainable params: 3,453,121
    Non-trainable params: 0
    _________________________________________________________________
&#96;&#96;&#96;bash


&#96;&#96;&#96;python
# 代码5-6 配置模型用于训练
from keras import optimizers

model.compile(loss&#x3D;&#39;binary_crossentropy&#39;,
              optimizer&#x3D;optimizers.RMSprop(lr&#x3D;1e-4),
              metrics&#x3D;[&#39;acc&#39;])<span aria-hidden="true" class="line-numbers-rows"><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span></span></code></pre>
<h1>四、数据预处理</h1>
<ul>
<li>读取图像文件。</li>
<li>将JPEG文件解码为RGB像素网格。</li>
<li>将这些像素网格转换为浮点数张量。</li>
<li>将像素值（0~255范围内）缩放到[0,1]区间（神经网络喜欢处理较小的输入值）</li>
</ul>
<pre class="line-numbers language-python" data-language="python"><code class="language-python"># 代码清单5-7 使用ImageDataGenerator从目录中读取图像
from keras.preprocessing.image import ImageDataGenerator
# 将所有图像乘以1&#x2F;255的缩放
train_datagen &#x3D; ImageDataGenerator(rescale&#x3D;1.&#x2F;255)
test_datagen &#x3D; ImageDataGenerator(rescale&#x3D;1.&#x2F;255)

train_generator &#x3D; train_datagen.flow_from_directory(train_dir,              #目标目录
                                                  target_size&#x3D;(150, 150), #将所有图像的大小调整为150*150
                                                  batch_size&#x3D;20,
                                                  class_mode&#x3D;&#39;binary&#39;)    #因为使用了binary_crossentropy所以需要用二进制标签

validation_generator &#x3D; test_datagen.flow_from_directory(validation_dir,
                                                        target_size&#x3D;(150, 150),
                                                        batch_size&#x3D;20,
                                                        class_mode&#x3D;&#39;binary&#39;)<span aria-hidden="true" class="line-numbers-rows"><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span></span></code></pre>
<pre class="line-numbers language-bash" data-language="bash"><code class="language-bash">Using TensorFlow backend.



---------------------------------------------------------------------------

NameError                                 Traceback (most recent call last)

&lt;ipython-input-1-c6831c7c10cb&gt; in &lt;module&gt;
      5 test_datagen &#x3D; ImageDataGenerator(rescale&#x3D;1.&#x2F;255)
      6 
----&gt; 7 train_generator &#x3D; train_datagen.flow_from_directory(train_dir,              #目标目录
      8                                                   target_size&#x3D;(150, 150), #将所有图像的大小调整为150*150
      9                                                   batch_size&#x3D;20,


NameError: name &#39;train_dir&#39; is not defined<span aria-hidden="true" class="line-numbers-rows"><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span></span></code></pre>
<pre class="line-numbers language-python" data-language="python"><code class="language-python">history &#x3D; model.fit_generator(train_generator,
                              steps_per_epoch&#x3D;100,
                              epochs&#x3D;30,
                              validation_data&#x3D;validation_generator,
                              validation_steps&#x3D;50)<span aria-hidden="true" class="line-numbers-rows"><span></span><span></span><span></span><span></span><span></span></span></code></pre>
<pre class="line-numbers language-bash" data-language="bash"><code class="language-bash">Epoch 1&#x2F;30
100&#x2F;100 [&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;] - 78s 776ms&#x2F;step - loss: 0.6816 - acc: 0.5570 - val_loss: 0.6213 - val_acc: 0.6490
Epoch 2&#x2F;30
100&#x2F;100 [&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;] - 65s 652ms&#x2F;step - loss: 0.6176 - acc: 0.6595 - val_loss: 0.6322 - val_acc: 0.6420
Epoch 3&#x2F;30
100&#x2F;100 [&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;] - 51s 509ms&#x2F;step - loss: 0.5574 - acc: 0.7100 - val_loss: 0.5623 - val_acc: 0.6490
Epoch 4&#x2F;30
100&#x2F;100 [&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;] - 51s 507ms&#x2F;step - loss: 0.5134 - acc: 0.7480 - val_loss: 0.5853 - val_acc: 0.6880
Epoch 5&#x2F;30
100&#x2F;100 [&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;] - 50s 499ms&#x2F;step - loss: 0.4765 - acc: 0.7740 - val_loss: 0.7311 - val_acc: 0.6810
Epoch 6&#x2F;30
100&#x2F;100 [&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;] - 50s 503ms&#x2F;step - loss: 0.4322 - acc: 0.7990 - val_loss: 0.4681 - val_acc: 0.6900
Epoch 7&#x2F;30
100&#x2F;100 [&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;] - 50s 497ms&#x2F;step - loss: 0.3921 - acc: 0.8280 - val_loss: 0.6024 - val_acc: 0.7010
Epoch 8&#x2F;30
100&#x2F;100 [&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;] - 50s 501ms&#x2F;step - loss: 0.3475 - acc: 0.8480 - val_loss: 0.8479 - val_acc: 0.7090
Epoch 9&#x2F;30
100&#x2F;100 [&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;] - 50s 498ms&#x2F;step - loss: 0.3040 - acc: 0.8860 - val_loss: 0.7184 - val_acc: 0.6920
Epoch 10&#x2F;30
100&#x2F;100 [&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;] - 50s 496ms&#x2F;step - loss: 0.2617 - acc: 0.9000 - val_loss: 0.5692 - val_acc: 0.7030
Epoch 11&#x2F;30
100&#x2F;100 [&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;] - 50s 498ms&#x2F;step - loss: 0.2196 - acc: 0.9260 - val_loss: 0.5683 - val_acc: 0.7170
Epoch 12&#x2F;30
100&#x2F;100 [&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;] - 50s 500ms&#x2F;step - loss: 0.1713 - acc: 0.9455 - val_loss: 0.4114 - val_acc: 0.7020
Epoch 13&#x2F;30
100&#x2F;100 [&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;] - 50s 501ms&#x2F;step - loss: 0.1322 - acc: 0.9635 - val_loss: 0.6686 - val_acc: 0.6720
Epoch 14&#x2F;30
100&#x2F;100 [&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;] - 50s 504ms&#x2F;step - loss: 0.1090 - acc: 0.9665 - val_loss: 1.1488 - val_acc: 0.7110
Epoch 15&#x2F;30
100&#x2F;100 [&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;] - 50s 498ms&#x2F;step - loss: 0.0778 - acc: 0.9825 - val_loss: 0.8488 - val_acc: 0.6850
Epoch 16&#x2F;30
100&#x2F;100 [&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;] - 50s 499ms&#x2F;step - loss: 0.0591 - acc: 0.9870 - val_loss: 0.8650 - val_acc: 0.6950
Epoch 17&#x2F;30
100&#x2F;100 [&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;] - 50s 502ms&#x2F;step - loss: 0.0432 - acc: 0.9925 - val_loss: 1.3993 - val_acc: 0.6880
Epoch 18&#x2F;30
100&#x2F;100 [&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;] - 50s 499ms&#x2F;step - loss: 0.0269 - acc: 0.9950 - val_loss: 0.6391 - val_acc: 0.7030
Epoch 19&#x2F;30
100&#x2F;100 [&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;] - 50s 497ms&#x2F;step - loss: 0.0201 - acc: 0.9970 - val_loss: 0.9204 - val_acc: 0.7100
Epoch 20&#x2F;30
100&#x2F;100 [&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;] - 52s 515ms&#x2F;step - loss: 0.0145 - acc: 0.9965 - val_loss: 0.6482 - val_acc: 0.6960
Epoch 21&#x2F;30
100&#x2F;100 [&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;] - 52s 524ms&#x2F;step - loss: 0.0108 - acc: 0.9990 - val_loss: 2.3934 - val_acc: 0.6920
Epoch 22&#x2F;30
100&#x2F;100 [&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;] - 50s 499ms&#x2F;step - loss: 0.0082 - acc: 0.9985 - val_loss: 1.6192 - val_acc: 0.6930
Epoch 23&#x2F;30
100&#x2F;100 [&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;] - 50s 504ms&#x2F;step - loss: 0.0065 - acc: 0.9990 - val_loss: 0.9008 - val_acc: 0.6990
Epoch 24&#x2F;30
100&#x2F;100 [&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;] - 50s 501ms&#x2F;step - loss: 0.0053 - acc: 0.9990 - val_loss: 2.3428 - val_acc: 0.6950
Epoch 25&#x2F;30
100&#x2F;100 [&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;] - 50s 502ms&#x2F;step - loss: 0.0036 - acc: 0.9985 - val_loss: 1.4853 - val_acc: 0.6990
Epoch 26&#x2F;30
100&#x2F;100 [&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;] - 51s 509ms&#x2F;step - loss: 0.0030 - acc: 0.9990 - val_loss: 1.3488 - val_acc: 0.6940
Epoch 27&#x2F;30
100&#x2F;100 [&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;] - 51s 510ms&#x2F;step - loss: 0.0028 - acc: 0.9995 - val_loss: 0.6445 - val_acc: 0.6870
Epoch 28&#x2F;30
100&#x2F;100 [&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;] - 50s 505ms&#x2F;step - loss: 0.0059 - acc: 0.9970 - val_loss: 2.2535 - val_acc: 0.6880
Epoch 29&#x2F;30
100&#x2F;100 [&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;] - 50s 504ms&#x2F;step - loss: 0.0023 - acc: 0.9990 - val_loss: 2.2277 - val_acc: 0.6920
Epoch 30&#x2F;30
100&#x2F;100 [&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;] - 51s 511ms&#x2F;step - loss: 0.0050 - acc: 0.9985 - val_loss: 2.3373 - val_acc: 0.6790<span aria-hidden="true" class="line-numbers-rows"><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span></span></code></pre>
<pre class="line-numbers language-python" data-language="python"><code class="language-python"># 代码清单5-9 保存模型
model.save(&#39;D:&#x2F;&#x2F;cats_and_dags_small_1.h5&#39;)<span aria-hidden="true" class="line-numbers-rows"><span></span><span></span></span></code></pre>
<pre class="line-numbers language-python" data-language="python"><code class="language-python"># 绘制训练过程中模型的损失曲线和精度曲线
import matplotlib.pyplot as plt

acc &#x3D; history.history[&#39;acc&#39;]
val_acc &#x3D; history.history[&#39;val_acc&#39;]
loss &#x3D; history.history[&#39;loss&#39;]
val_loss &#x3D; history.history[&#39;val_loss&#39;]

epochs &#x3D; range(1, len(acc) + 1)

plt.plot(epochs, acc, &#39;bo&#39;, label&#x3D;&#39;Training acc&#39;)
plt.plot(epochs, val_acc, &#39;r&#39;, label&#x3D;&#39;Validation acc&#39;)
plt.title(&#39;Training acc and Validation acc&#39;)
plt.legend()

plt.figure()

plt.plot(epochs, loss, &#39;bo&#39;, label&#x3D;&#39;Training loss&#39;)
plt.plot(epochs, val_loss, &#39;r&#39;, label&#x3D;&#39;Validation loss&#39;)
plt.title(&#39;Training loss and Validation loss&#39;)
plt.legend()

plt.figure()

plt.show()<span aria-hidden="true" class="line-numbers-rows"><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span></span></code></pre>
<p><img src="./medias/loading1.gif" data-original="https://cdn.jsdelivr.net/gh/LiU-YU-HANG/blogpic@main/test1/202303022313267.png" alt=""></p>
<p><img src="./medias/loading1.gif" data-original="https://cdn.jsdelivr.net/gh/LiU-YU-HANG/blogpic@main/test1/202303022313676.png" alt=""></p>
<pre class="line-numbers language-bash" data-language="bash"><code class="language-bash">    &lt;Figure size 432x288 with 0 Axes&gt;
&#96; 由于样本数据较少所以模型出现了过拟合的特征，可以用 dropout和权重衰减（L2正则化）。在计算机视觉邻域的新方法，在深度学习模型处理图像时几乎都会用到这种方法，他就是数据增强(data augmentation)

## 五、使用数据增强
#### 过拟合的原因是学习的样本太少，导致无法训练出能够泛化到新数据的模型。如果拥有无限的数据，那么模型能够观察到数据的更多内容，从而具有更好的泛化能力。


&#96;&#96;&#96;python
# 代码5-11 利用ImageDataGenerator来设置数据增强
datagen &#x3D; ImageDataGenerator(rotation_range&#x3D;40,
                             width_shift_range&#x3D;0.2,
                             height_shift_range&#x3D;0.2,
                             shear_range&#x3D;0.2,
                             zoom_range&#x3D;0.2,
                             horizontal_flip&#x3D;True,
                             fill_mode&#x3D;&#39;nearest&#39;)<span aria-hidden="true" class="line-numbers-rows"><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span></span></code></pre>
<ul>
<li>rotation_range是角度值（在0~180范围内），表示图像随机旋转的角度范围</li>
<li>width_shift和height_shift是图像在水平或垂直方向上平移的范围（相对于总高度和总宽度的比例）。</li>
<li>shear_range是随机错切变换的角度</li>
<li>zoom_range是图像随机缩放的范围<br>
- horizontal_flip是随机将一半图像水平翻转</li>
<li>fill_mode是用于填充新创建的方法，这些像素可能来自于旋转或宽度、高度平移</li>
</ul>
<pre class="line-numbers language-python" data-language="python"><code class="language-python"># 代码5-12 显示几个随机增强后的训练图像
from keras.preprocessing import image # 图像预处理工具的模块

# 获取指定目录列表
fnames &#x3D; [os.path.join(train_cats_dir, fname) for fname in os.listdir(train_cats_dir)]
# 选择一张图片进行增强
img_path &#x3D; fnames[3]
# 读取图像并调整大小
img &#x3D; image.load_img(img_path, target_size&#x3D;(150, 150))
# 将其转换为形状(150, 150, 3)的Numpy数组
x &#x3D; image.img_to_array(img)
# 将其形状改变为（1， 150， 150， 3）
x &#x3D; x.reshape((1,) + x.shape)

# 生成随机变换后的图像批量。
i &#x3D; 0
for batch in datagen.flow(x, batch_size&#x3D;1):
    plt.figure(i)
    imgplot &#x3D; plt.imshow(image.array_to_img(batch[0]))
    i +&#x3D; 1
    if i%4 &#x3D;&#x3D; 0:
        break
        
plt.show()<span aria-hidden="true" class="line-numbers-rows"><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span></span></code></pre>
<p><img src="./medias/loading1.gif" data-original="https://cdn.jsdelivr.net/gh/LiU-YU-HANG/blogpic@main/test1/202303022313496.png" alt=""></p>
<p><img src="./medias/loading1.gif" data-original="https://cdn.jsdelivr.net/gh/LiU-YU-HANG/blogpic@main/test1/202303022313680.png" alt=""></p>
<p><img src="./medias/loading1.gif" data-original="https://cdn.jsdelivr.net/gh/LiU-YU-HANG/blogpic@main/test1/202303022313599.png" alt=""></p>
<p><img src="./medias/loading1.gif" data-original="https://cdn.jsdelivr.net/gh/LiU-YU-HANG/blogpic@main/test1/202303022314114.png" alt=""></p>
<h4 id="数据增强不足以完全消除过拟合，为了进一步降低过拟合，还需要向网络中添加一个Dropout层，添加到密集连接分类器中。">数据增强不足以完全消除过拟合，为了进一步降低过拟合，还需要向网络中添加一个Dropout层，添加到密集连接分类器中。</h4>
<pre class="line-numbers language-python" data-language="python"><code class="language-python"># 代码5-13 定义一个包含dropout的新卷积神经网络
model &#x3D; models.Sequential()
model.add(layers.Conv2D(32, (3, 3), activation&#x3D;&#39;relu&#39;,
                        input_shape&#x3D;(150, 150, 3)))
model.add(layers.MaxPooling2D((2, 2)))
model.add(layers.Conv2D(64, (3, 3), activation&#x3D;&#39;relu&#39;))
model.add(layers.MaxPooling2D((2, 2)))
model.add(layers.Conv2D(128, (3, 3)))
model.add(layers.MaxPooling2D((2, 2)))
model.add(layers.Conv2D(128, (3, 3)))
model.add(layers.MaxPooling2D((2, 2)))
model.add(layers.Flatten())
model.add(layers.Dropout(0.5))
model.add(layers.Dense(512, activation&#x3D;&#39;relu&#39;))
model.add(layers.Dense(1, activation&#x3D;&#39;sigmoid&#39;))

model.compile(loss&#x3D;&#39;binary_crossentropy&#39;,
              optimizer&#x3D;optimizers.RMSprop(lr&#x3D;1e-4),
              metrics&#x3D;[&#39;acc&#39;])<span aria-hidden="true" class="line-numbers-rows"><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span></span></code></pre>
<pre class="line-numbers language-python" data-language="python"><code class="language-python"># 代码5-14 利用数据增强生成器训练卷积神经网络
train_datagen &#x3D; ImageDataGenerator(rescale&#x3D;1.&#x2F;255,          # 设置缩放率
                                   rotation_range&#x3D;40,       # 角度范围
                                   width_shift_range&#x3D;0.2,   # 宽平移范围
                                   height_shift_range&#x3D;0.2,  # 高平移范围
                                   shear_range&#x3D;0.2,         # 随机错切变换
                                   zoom_range&#x3D;0.2,          # 图像随机缩放范围
                                   horizontal_flip&#x3D;True,)   # 将一半图像水平翻转

test_datagen &#x3D; ImageDataGenerator(rescale&#x3D;1.&#x2F;255) # 不能增强验证数据

train_generator &#x3D; train_datagen.flow_from_directory(train_dir,
                                                    target_size&#x3D;(150, 150),
                                                    batch_size&#x3D;32,
                                                    class_mode&#x3D;&#39;binary&#39;)

validation_generator &#x3D; test_datagen.flow_from_directory(validation_dir,
                                                        target_size&#x3D;(150, 150),
                                                        batch_size&#x3D;32,
                                                        class_mode&#x3D;&#39;binary&#39;)

history &#x3D; model.fit_generator(train_generator,
                              steps_per_epoch&#x3D;100, 
                              epochs&#x3D;100,
                              validation_data&#x3D;validation_generator,
                              validation_steps&#x3D;50)<span aria-hidden="true" class="line-numbers-rows"><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span></span></code></pre>
<pre class="line-numbers language-bash" data-language="bash"><code class="language-bash">Found 2000 images belonging to 2 classes.
Found 1000 images belonging to 2 classes.
Epoch 1&#x2F;100
100&#x2F;100 [&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;] - 125s 1s&#x2F;step - loss: 0.6913 - acc: 0.5271 - val_loss: 0.7078 - val_acc: 0.5628
Epoch 2&#x2F;100
100&#x2F;100 [&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;] - 79s 789ms&#x2F;step - loss: 0.6695 - acc: 0.5811 - val_loss: 0.6501 - val_acc: 0.6134
Epoch 3&#x2F;100
100&#x2F;100 [&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;] - 80s 796ms&#x2F;step - loss: 0.6508 - acc: 0.6112 - val_loss: 0.5806 - val_acc: 0.6662
Epoch 4&#x2F;100
100&#x2F;100 [&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;] - 80s 804ms&#x2F;step - loss: 0.6230 - acc: 0.6492 - val_loss: 0.6536 - val_acc: 0.6418
Epoch 5&#x2F;100
100&#x2F;100 [&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;] - 78s 782ms&#x2F;step - loss: 0.6244 - acc: 0.6503 - val_loss: 0.6034 - val_acc: 0.6504
Epoch 6&#x2F;100
100&#x2F;100 [&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;] - 83s 830ms&#x2F;step - loss: 0.6064 - acc: 0.6649 - val_loss: 0.5600 - val_acc: 0.6888
Epoch 7&#x2F;100
100&#x2F;100 [&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;] - 79s 790ms&#x2F;step - loss: 0.5889 - acc: 0.6843 - val_loss: 0.5186 - val_acc: 0.6910
Epoch 8&#x2F;100
100&#x2F;100 [&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;] - 79s 787ms&#x2F;step - loss: 0.5895 - acc: 0.6774 - val_loss: 0.5555 - val_acc: 0.7210
Epoch 9&#x2F;100
100&#x2F;100 [&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;] - 81s 808ms&#x2F;step - loss: 0.5760 - acc: 0.6875 - val_loss: 0.5773 - val_acc: 0.7242
Epoch 10&#x2F;100
100&#x2F;100 [&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;] - 81s 807ms&#x2F;step - loss: 0.5729 - acc: 0.6963 - val_loss: 0.4982 - val_acc: 0.7240
Epoch 11&#x2F;100
100&#x2F;100 [&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;] - 81s 811ms&#x2F;step - loss: 0.5702 - acc: 0.6954 - val_loss: 0.4673 - val_acc: 0.7159
Epoch 12&#x2F;100
100&#x2F;100 [&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;] - 82s 824ms&#x2F;step - loss: 0.5650 - acc: 0.7039 - val_loss: 0.6263 - val_acc: 0.7176
Epoch 13&#x2F;100
100&#x2F;100 [&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;] - 80s 800ms&#x2F;step - loss: 0.5611 - acc: 0.7083 - val_loss: 0.5402 - val_acc: 0.7397
Epoch 14&#x2F;100
100&#x2F;100 [&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;] - 79s 787ms&#x2F;step - loss: 0.5414 - acc: 0.7293 - val_loss: 0.4399 - val_acc: 0.7392
Epoch 15&#x2F;100
100&#x2F;100 [&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;] - 81s 814ms&#x2F;step - loss: 0.5382 - acc: 0.7314 - val_loss: 0.7051 - val_acc: 0.7120
Epoch 16&#x2F;100
100&#x2F;100 [&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;] - 78s 784ms&#x2F;step - loss: 0.5284 - acc: 0.7383 - val_loss: 0.4862 - val_acc: 0.7307
Epoch 17&#x2F;100
100&#x2F;100 [&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;] - 80s 797ms&#x2F;step - loss: 0.5321 - acc: 0.7242 - val_loss: 0.4120 - val_acc: 0.7462
Epoch 18&#x2F;100
100&#x2F;100 [&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;] - 83s 829ms&#x2F;step - loss: 0.5168 - acc: 0.7408 - val_loss: 0.5012 - val_acc: 0.7358
Epoch 19&#x2F;100
100&#x2F;100 [&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;] - 78s 781ms&#x2F;step - loss: 0.5358 - acc: 0.7219 - val_loss: 0.5706 - val_acc: 0.7119
Epoch 20&#x2F;100
100&#x2F;100 [&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;] - 84s 843ms&#x2F;step - loss: 0.5167 - acc: 0.7428 - val_loss: 0.4900 - val_acc: 0.7590
Epoch 21&#x2F;100
100&#x2F;100 [&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;] - 82s 816ms&#x2F;step - loss: 0.5153 - acc: 0.7396 - val_loss: 0.3454 - val_acc: 0.7576
Epoch 22&#x2F;100
100&#x2F;100 [&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;] - 83s 835ms&#x2F;step - loss: 0.5085 - acc: 0.7409 - val_loss: 0.5361 - val_acc: 0.7455
Epoch 23&#x2F;100
100&#x2F;100 [&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;] - 81s 809ms&#x2F;step - loss: 0.5111 - acc: 0.7481 - val_loss: 0.3308 - val_acc: 0.7703
Epoch 24&#x2F;100
100&#x2F;100 [&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;] - 81s 810ms&#x2F;step - loss: 0.5053 - acc: 0.7509 - val_loss: 0.5429 - val_acc: 0.7487
Epoch 25&#x2F;100
100&#x2F;100 [&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;] - 81s 810ms&#x2F;step - loss: 0.5093 - acc: 0.7431 - val_loss: 0.4574 - val_acc: 0.7597
Epoch 26&#x2F;100
100&#x2F;100 [&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;] - 84s 843ms&#x2F;step - loss: 0.5085 - acc: 0.7437 - val_loss: 0.5110 - val_acc: 0.7468
Epoch 27&#x2F;100
100&#x2F;100 [&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;] - 81s 809ms&#x2F;step - loss: 0.4916 - acc: 0.7620 - val_loss: 0.4438 - val_acc: 0.7577
Epoch 28&#x2F;100
100&#x2F;100 [&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;] - 81s 808ms&#x2F;step - loss: 0.4891 - acc: 0.7617 - val_loss: 0.4215 - val_acc: 0.7817
Epoch 29&#x2F;100
100&#x2F;100 [&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;] - 81s 812ms&#x2F;step - loss: 0.4885 - acc: 0.7673 - val_loss: 0.5499 - val_acc: 0.7519
Epoch 30&#x2F;100
100&#x2F;100 [&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;] - 81s 810ms&#x2F;step - loss: 0.4902 - acc: 0.7614 - val_loss: 0.5794 - val_acc: 0.7779
Epoch 31&#x2F;100
100&#x2F;100 [&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;] - 82s 817ms&#x2F;step - loss: 0.4890 - acc: 0.7601 - val_loss: 0.3642 - val_acc: 0.7835
Epoch 32&#x2F;100
100&#x2F;100 [&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;] - 81s 808ms&#x2F;step - loss: 0.4842 - acc: 0.7717 - val_loss: 0.6966 - val_acc: 0.7706
Epoch 33&#x2F;100
100&#x2F;100 [&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;] - 81s 808ms&#x2F;step - loss: 0.4689 - acc: 0.7781 - val_loss: 0.6249 - val_acc: 0.7766
Epoch 34&#x2F;100
100&#x2F;100 [&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;] - 80s 802ms&#x2F;step - loss: 0.4684 - acc: 0.7746 - val_loss: 0.5836 - val_acc: 0.7552
Epoch 35&#x2F;100
100&#x2F;100 [&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;] - 81s 807ms&#x2F;step - loss: 0.4627 - acc: 0.7797 - val_loss: 0.6568 - val_acc: 0.7830
Epoch 36&#x2F;100
100&#x2F;100 [&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;] - 81s 809ms&#x2F;step - loss: 0.4891 - acc: 0.7566 - val_loss: 0.4429 - val_acc: 0.7751
Epoch 37&#x2F;100
100&#x2F;100 [&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;] - 82s 817ms&#x2F;step - loss: 0.4744 - acc: 0.7711 - val_loss: 0.3420 - val_acc: 0.7576
Epoch 38&#x2F;100
100&#x2F;100 [&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;] - 81s 815ms&#x2F;step - loss: 0.4677 - acc: 0.7657 - val_loss: 0.4377 - val_acc: 0.7854
Epoch 39&#x2F;100
100&#x2F;100 [&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;] - 80s 804ms&#x2F;step - loss: 0.4697 - acc: 0.7727 - val_loss: 0.4234 - val_acc: 0.7786
Epoch 40&#x2F;100
100&#x2F;100 [&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;] - 81s 812ms&#x2F;step - loss: 0.4626 - acc: 0.7839 - val_loss: 0.4202 - val_acc: 0.7693
Epoch 41&#x2F;100
100&#x2F;100 [&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;] - 80s 804ms&#x2F;step - loss: 0.4570 - acc: 0.7926 - val_loss: 0.3804 - val_acc: 0.7899
Epoch 42&#x2F;100
100&#x2F;100 [&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;] - 80s 804ms&#x2F;step - loss: 0.4688 - acc: 0.7721 - val_loss: 0.4593 - val_acc: 0.8014
Epoch 43&#x2F;100
100&#x2F;100 [&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;] - 81s 806ms&#x2F;step - loss: 0.4582 - acc: 0.7889 - val_loss: 0.3119 - val_acc: 0.7803
Epoch 44&#x2F;100
100&#x2F;100 [&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;] - 81s 807ms&#x2F;step - loss: 0.4588 - acc: 0.7803 - val_loss: 0.5071 - val_acc: 0.7849
Epoch 45&#x2F;100
100&#x2F;100 [&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;] - 81s 805ms&#x2F;step - loss: 0.4497 - acc: 0.7827 - val_loss: 0.2799 - val_acc: 0.7790
Epoch 46&#x2F;100
100&#x2F;100 [&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;] - 80s 802ms&#x2F;step - loss: 0.4504 - acc: 0.7879 - val_loss: 0.5933 - val_acc: 0.7906
Epoch 47&#x2F;100
100&#x2F;100 [&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;] - 81s 806ms&#x2F;step - loss: 0.4486 - acc: 0.7838 - val_loss: 0.3755 - val_acc: 0.7925
Epoch 48&#x2F;100
100&#x2F;100 [&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;] - 81s 809ms&#x2F;step - loss: 0.4462 - acc: 0.7911 - val_loss: 0.6384 - val_acc: 0.7777
Epoch 49&#x2F;100
100&#x2F;100 [&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;] - 81s 807ms&#x2F;step - loss: 0.4621 - acc: 0.7775 - val_loss: 0.6330 - val_acc: 0.7824
Epoch 50&#x2F;100
100&#x2F;100 [&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;] - 80s 804ms&#x2F;step - loss: 0.4403 - acc: 0.7946 - val_loss: 0.5694 - val_acc: 0.7790
Epoch 51&#x2F;100
100&#x2F;100 [&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;] - 81s 807ms&#x2F;step - loss: 0.4425 - acc: 0.7945 - val_loss: 0.4183 - val_acc: 0.8058
Epoch 52&#x2F;100
100&#x2F;100 [&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;] - 81s 808ms&#x2F;step - loss: 0.4420 - acc: 0.7981 - val_loss: 0.3702 - val_acc: 0.7719
Epoch 53&#x2F;100
100&#x2F;100 [&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;] - 80s 803ms&#x2F;step - loss: 0.4442 - acc: 0.7977 - val_loss: 0.4735 - val_acc: 0.7906
Epoch 54&#x2F;100
100&#x2F;100 [&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;] - 88s 880ms&#x2F;step - loss: 0.4425 - acc: 0.7933 - val_loss: 0.3696 - val_acc: 0.8003
Epoch 55&#x2F;100
100&#x2F;100 [&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;] - 80s 798ms&#x2F;step - loss: 0.4313 - acc: 0.7944 - val_loss: 0.5504 - val_acc: 0.7563
Epoch 56&#x2F;100
100&#x2F;100 [&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;] - 81s 812ms&#x2F;step - loss: 0.4299 - acc: 0.8075 - val_loss: 0.5207 - val_acc: 0.7642
Epoch 57&#x2F;100
100&#x2F;100 [&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;] - 81s 807ms&#x2F;step - loss: 0.4278 - acc: 0.8024 - val_loss: 0.4682 - val_acc: 0.7880
Epoch 58&#x2F;100
100&#x2F;100 [&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;] - 81s 812ms&#x2F;step - loss: 0.4391 - acc: 0.7914 - val_loss: 0.4577 - val_acc: 0.8008
Epoch 59&#x2F;100
100&#x2F;100 [&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;] - 82s 816ms&#x2F;step - loss: 0.4327 - acc: 0.8006 - val_loss: 0.5256 - val_acc: 0.7732
Epoch 60&#x2F;100
100&#x2F;100 [&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;] - 81s 811ms&#x2F;step - loss: 0.4182 - acc: 0.7992 - val_loss: 0.4894 - val_acc: 0.7944
Epoch 61&#x2F;100
100&#x2F;100 [&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;] - 81s 812ms&#x2F;step - loss: 0.4171 - acc: 0.8087 - val_loss: 0.5639 - val_acc: 0.7867
Epoch 62&#x2F;100
100&#x2F;100 [&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;] - 81s 808ms&#x2F;step - loss: 0.4398 - acc: 0.7911 - val_loss: 0.5572 - val_acc: 0.7989
Epoch 63&#x2F;100
100&#x2F;100 [&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;] - 81s 808ms&#x2F;step - loss: 0.4186 - acc: 0.8074 - val_loss: 0.2321 - val_acc: 0.7816
Epoch 64&#x2F;100
100&#x2F;100 [&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;] - 81s 807ms&#x2F;step - loss: 0.4200 - acc: 0.8112 - val_loss: 0.4757 - val_acc: 0.7970
Epoch 65&#x2F;100
100&#x2F;100 [&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;] - 81s 811ms&#x2F;step - loss: 0.4151 - acc: 0.8122 - val_loss: 0.3688 - val_acc: 0.7919
Epoch 66&#x2F;100
100&#x2F;100 [&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;] - 81s 808ms&#x2F;step - loss: 0.4290 - acc: 0.8021 - val_loss: 0.3659 - val_acc: 0.8164
Epoch 67&#x2F;100
100&#x2F;100 [&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;] - 81s 808ms&#x2F;step - loss: 0.4246 - acc: 0.8071 - val_loss: 0.5000 - val_acc: 0.7881
Epoch 68&#x2F;100
100&#x2F;100 [&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;] - 81s 806ms&#x2F;step - loss: 0.4231 - acc: 0.8005 - val_loss: 0.2848 - val_acc: 0.8061
Epoch 69&#x2F;100
100&#x2F;100 [&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;] - 81s 807ms&#x2F;step - loss: 0.4180 - acc: 0.7967 - val_loss: 0.4099 - val_acc: 0.7938
Epoch 70&#x2F;100
100&#x2F;100 [&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;] - 81s 811ms&#x2F;step - loss: 0.4054 - acc: 0.8094 - val_loss: 0.5025 - val_acc: 0.7983
Epoch 71&#x2F;100
100&#x2F;100 [&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;] - 81s 812ms&#x2F;step - loss: 0.4106 - acc: 0.8169 - val_loss: 0.4391 - val_acc: 0.7957
Epoch 72&#x2F;100
100&#x2F;100 [&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;] - 81s 813ms&#x2F;step - loss: 0.4002 - acc: 0.8210 - val_loss: 0.2933 - val_acc: 0.8054
Epoch 73&#x2F;100
100&#x2F;100 [&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;] - 81s 811ms&#x2F;step - loss: 0.4039 - acc: 0.8087 - val_loss: 0.4964 - val_acc: 0.7925
Epoch 74&#x2F;100
100&#x2F;100 [&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;] - 81s 815ms&#x2F;step - loss: 0.3979 - acc: 0.8200 - val_loss: 0.3591 - val_acc: 0.8046
Epoch 75&#x2F;100
100&#x2F;100 [&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;] - 81s 807ms&#x2F;step - loss: 0.4038 - acc: 0.8179 - val_loss: 0.3446 - val_acc: 0.7919
Epoch 76&#x2F;100
100&#x2F;100 [&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;] - 81s 811ms&#x2F;step - loss: 0.4015 - acc: 0.8197 - val_loss: 0.5907 - val_acc: 0.8090
Epoch 77&#x2F;100
100&#x2F;100 [&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;] - 81s 809ms&#x2F;step - loss: 0.3929 - acc: 0.8194 - val_loss: 0.4378 - val_acc: 0.8093
Epoch 78&#x2F;100
100&#x2F;100 [&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;] - 81s 810ms&#x2F;step - loss: 0.4002 - acc: 0.8220 - val_loss: 0.6263 - val_acc: 0.8103
Epoch 79&#x2F;100
100&#x2F;100 [&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;] - 81s 809ms&#x2F;step - loss: 0.4062 - acc: 0.8131 - val_loss: 0.6074 - val_acc: 0.8035
Epoch 80&#x2F;100
100&#x2F;100 [&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;] - 80s 801ms&#x2F;step - loss: 0.3949 - acc: 0.8179 - val_loss: 0.2403 - val_acc: 0.7829
Epoch 81&#x2F;100
100&#x2F;100 [&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;] - 81s 815ms&#x2F;step - loss: 0.3878 - acc: 0.8229 - val_loss: 0.4299 - val_acc: 0.8135
Epoch 82&#x2F;100
100&#x2F;100 [&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;] - 81s 813ms&#x2F;step - loss: 0.4048 - acc: 0.8166 - val_loss: 0.4459 - val_acc: 0.7835
Epoch 83&#x2F;100
100&#x2F;100 [&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;] - 81s 808ms&#x2F;step - loss: 0.3748 - acc: 0.8311 - val_loss: 0.4246 - val_acc: 0.8128
Epoch 84&#x2F;100
100&#x2F;100 [&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;] - 81s 811ms&#x2F;step - loss: 0.3763 - acc: 0.8348 - val_loss: 0.3641 - val_acc: 0.8241
Epoch 85&#x2F;100
100&#x2F;100 [&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;] - 81s 805ms&#x2F;step - loss: 0.3841 - acc: 0.8308 - val_loss: 0.3874 - val_acc: 0.7989
Epoch 86&#x2F;100
100&#x2F;100 [&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;] - 82s 815ms&#x2F;step - loss: 0.3939 - acc: 0.8119 - val_loss: 0.3579 - val_acc: 0.8189
Epoch 87&#x2F;100
100&#x2F;100 [&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;] - 81s 808ms&#x2F;step - loss: 0.3823 - acc: 0.8305 - val_loss: 0.2843 - val_acc: 0.7862
Epoch 88&#x2F;100
100&#x2F;100 [&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;] - 80s 804ms&#x2F;step - loss: 0.3789 - acc: 0.8327 - val_loss: 0.4667 - val_acc: 0.8041
Epoch 89&#x2F;100
100&#x2F;100 [&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;] - 81s 809ms&#x2F;step - loss: 0.3854 - acc: 0.8201 - val_loss: 0.4003 - val_acc: 0.7996
Epoch 90&#x2F;100
100&#x2F;100 [&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;] - 81s 810ms&#x2F;step - loss: 0.3859 - acc: 0.8320 - val_loss: 0.5644 - val_acc: 0.8052
Epoch 91&#x2F;100
100&#x2F;100 [&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;] - 81s 809ms&#x2F;step - loss: 0.3756 - acc: 0.8273 - val_loss: 0.4432 - val_acc: 0.8015
Epoch 92&#x2F;100
100&#x2F;100 [&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;] - 81s 806ms&#x2F;step - loss: 0.3696 - acc: 0.8343 - val_loss: 0.2627 - val_acc: 0.8109
Epoch 93&#x2F;100
100&#x2F;100 [&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;] - 82s 819ms&#x2F;step - loss: 0.3707 - acc: 0.8310 - val_loss: 0.5918 - val_acc: 0.7977
Epoch 94&#x2F;100
100&#x2F;100 [&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;] - 81s 808ms&#x2F;step - loss: 0.3684 - acc: 0.8346 - val_loss: 0.4500 - val_acc: 0.8014
Epoch 95&#x2F;100
100&#x2F;100 [&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;] - 81s 810ms&#x2F;step - loss: 0.3787 - acc: 0.8311 - val_loss: 0.3496 - val_acc: 0.8099
Epoch 96&#x2F;100
100&#x2F;100 [&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;] - 80s 803ms&#x2F;step - loss: 0.3616 - acc: 0.8406 - val_loss: 0.5573 - val_acc: 0.8131
Epoch 97&#x2F;100
100&#x2F;100 [&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;] - 81s 810ms&#x2F;step - loss: 0.3616 - acc: 0.8386 - val_loss: 0.3731 - val_acc: 0.8077
Epoch 98&#x2F;100
100&#x2F;100 [&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;] - 84s 843ms&#x2F;step - loss: 0.3721 - acc: 0.8314 - val_loss: 0.3633 - val_acc: 0.8138
Epoch 99&#x2F;100
100&#x2F;100 [&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;] - 81s 806ms&#x2F;step - loss: 0.3590 - acc: 0.8370 - val_loss: 0.4365 - val_acc: 0.8160
Epoch 100&#x2F;100
100&#x2F;100 [&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;&#x3D;] - 81s 814ms&#x2F;step - loss: 0.3678 - acc: 0.8390 - val_loss: 0.2959 - val_acc: 0.8061<span aria-hidden="true" class="line-numbers-rows"><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span></span></code></pre>
<pre class="line-numbers language-python" data-language="python"><code class="language-python"># 绘制训练过程中模型的损失曲线和精度曲线
import matplotlib.pyplot as plt

acc &#x3D; history.history[&#39;acc&#39;]
val_acc &#x3D; history.history[&#39;val_acc&#39;]
loss &#x3D; history.history[&#39;loss&#39;]
val_loss &#x3D; history.history[&#39;val_loss&#39;]

epochs &#x3D; range(1, len(acc) + 1)

plt.plot(epochs, acc, &#39;bo&#39;, label&#x3D;&#39;Training acc&#39;)
plt.plot(epochs, val_acc, &#39;r&#39;, label&#x3D;&#39;Validation acc&#39;)
plt.title(&#39;Training acc and Validation acc&#39;)
plt.legend()

plt.figure()

plt.plot(epochs, loss, &#39;bo&#39;, label&#x3D;&#39;Training loss&#39;)
plt.plot(epochs, val_loss, &#39;r&#39;, label&#x3D;&#39;Validation loss&#39;)
plt.title(&#39;Training loss and Validation loss&#39;)
plt.legend()

plt.figure()

plt.show()<span aria-hidden="true" class="line-numbers-rows"><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span></span></code></pre>
<p><img src="./medias/loading1.gif" data-original="https://cdn.jsdelivr.net/gh/LiU-YU-HANG/blogpic@main/test1/202303022314933.png" alt=""></p>
<p><img src="./medias/loading1.gif" data-original="https://cdn.jsdelivr.net/gh/LiU-YU-HANG/blogpic@main/test1/202303022314560.png" alt=""></p>
<pre class="line-numbers language-bash" data-language="bash"><code class="language-bash">&lt;Figure size 432x288 with 0 Axes&gt;<span aria-hidden="true" class="line-numbers-rows"><span></span></span></code></pre>
<pre class="line-numbers language-python" data-language="python"><code class="language-python">model.save(&#39;D:&#x2F;&#x2F;cats and dogs2.h5&#39;)<span aria-hidden="true" class="line-numbers-rows"><span></span></span></code></pre>

                
            </div>
            <hr/>

            

    <div class="reprint" id="reprint-statement">
        
            <div class="reprint__author">
                <span class="reprint-meta" style="font-weight: bold;">
                    <i class="fas fa-user">
                        文章作者:
                    </i>
                </span>
                <span class="reprint-info">
                    <a href="/gitee.io/about" rel="external nofollow noreferrer">YuHang Liu</a>
                </span>
            </div>
            <div class="reprint__type">
                <span class="reprint-meta" style="font-weight: bold;">
                    <i class="fas fa-link">
                        文章链接:
                    </i>
                </span>
                <span class="reprint-info">
                    <a href="http://lyhcyt_admin.gitee.io/gitee.io/gitee.io/2022/04/05/zai-xiao-xing-shu-ju-ji-shang-cong-tou-kai-shi-xun-lian-yi-ge-juan-ji-shen-jing-wang-luo/">http://lyhcyt_admin.gitee.io/gitee.io/gitee.io/2022/04/05/zai-xiao-xing-shu-ju-ji-shang-cong-tou-kai-shi-xun-lian-yi-ge-juan-ji-shen-jing-wang-luo/</a>
                </span>
            </div>
            <div class="reprint__notice">
                <span class="reprint-meta" style="font-weight: bold;">
                    <i class="fas fa-copyright">
                        版权声明:
                    </i>
                </span>
                <span class="reprint-info">
                    本博客所有文章除特別声明外，均采用
                    <a href="https://creativecommons.org/licenses/by/4.0/deed.zh" rel="external nofollow noreferrer" target="_blank">CC BY 4.0</a>
                    许可协议。转载请注明来源
                    <a href="/gitee.io/about" target="_blank">YuHang Liu</a>
                    !
                </span>
            </div>
        
    </div>

    <script async defer>
      document.addEventListener("copy", function (e) {
        let toastHTML = '<span>复制成功，请遵循本文的转载规则</span><button class="btn-flat toast-action" onclick="navToReprintStatement()" style="font-size: smaller">查看</a>';
        M.toast({html: toastHTML})
      });

      function navToReprintStatement() {
        $("html, body").animate({scrollTop: $("#reprint-statement").offset().top - 80}, 800);
      }
    </script>



            <div class="tag_share" style="display: block;">
                <div class="post-meta__tag-list" style="display: inline-block;">
                    
                        <div class="article-tag">
                            
                                <a href="/gitee.io/tags/keras/">
                                    <span class="chip bg-color">keras</span>
                                </a>
                            
                                <a href="/gitee.io/tags/python/">
                                    <span class="chip bg-color">python</span>
                                </a>
                            
                        </div>
                    
                </div>
                <div class="post_share" style="zoom: 80%; width: fit-content; display: inline-block; float: right; margin: -0.15rem 0;">
                    <link rel="stylesheet" type="text/css" href="/gitee.io/libs/share/css/share.min.css">
<div id="article-share">

    
    <div class="social-share" data-sites="twitter,facebook,google,qq,qzone,wechat,weibo,douban,linkedin" data-wechat-qrcode-helper="<p>微信扫一扫即可分享！</p>"></div>
    <script src="/gitee.io/libs/share/js/social-share.min.js"></script>
    

    

</div>

                </div>
            </div>
            
                <style>
    #reward {
        margin: 40px 0;
        text-align: center;
    }

    #reward .reward-link {
        font-size: 1.4rem;
        line-height: 38px;
    }

    #reward .btn-floating:hover {
        box-shadow: 0 6px 12px rgba(0, 0, 0, 0.2), 0 5px 15px rgba(0, 0, 0, 0.2);
    }

    #rewardModal {
        width: 320px;
        height: 350px;
    }

    #rewardModal .reward-title {
        margin: 15px auto;
        padding-bottom: 5px;
    }

    #rewardModal .modal-content {
        padding: 10px;
    }

    #rewardModal .close {
        position: absolute;
        right: 15px;
        top: 15px;
        color: rgba(0, 0, 0, 0.5);
        font-size: 1.3rem;
        line-height: 20px;
        cursor: pointer;
    }

    #rewardModal .close:hover {
        color: #ef5350;
        transform: scale(1.3);
        -moz-transform:scale(1.3);
        -webkit-transform:scale(1.3);
        -o-transform:scale(1.3);
    }

    #rewardModal .reward-tabs {
        margin: 0 auto;
        width: 210px;
    }

    .reward-tabs .tabs {
        height: 38px;
        margin: 10px auto;
        padding-left: 0;
    }

    .reward-content ul {
        padding-left: 0 !important;
    }

    .reward-tabs .tabs .tab {
        height: 38px;
        line-height: 38px;
    }

    .reward-tabs .tab a {
        color: #fff;
        background-color: #ccc;
    }

    .reward-tabs .tab a:hover {
        background-color: #ccc;
        color: #fff;
    }

    .reward-tabs .wechat-tab .active {
        color: #fff !important;
        background-color: #22AB38 !important;
    }

    .reward-tabs .alipay-tab .active {
        color: #fff !important;
        background-color: #019FE8 !important;
    }

    .reward-tabs .reward-img {
        width: 210px;
        height: 210px;
    }
</style>

<div id="reward">
    <a href="#rewardModal" class="reward-link modal-trigger btn-floating btn-medium waves-effect waves-light red">赏</a>

    <!-- Modal Structure -->
    <div id="rewardModal" class="modal">
        <div class="modal-content">
            <a class="close modal-close"><i class="fas fa-times"></i></a>
            <h4 class="reward-title">你的赏识是我前进的动力</h4>
            <div class="reward-content">
                <div class="reward-tabs">
                    <ul class="tabs row">
                        <li class="tab col s6 alipay-tab waves-effect waves-light"><a href="#alipay">支付宝</a></li>
                        <li class="tab col s6 wechat-tab waves-effect waves-light"><a href="#wechat">微 信</a></li>
                    </ul>
                    <div id="alipay">
                        <img src="./medias/loading1.gif" data-original="/gitee.io/medias/reward/alipay.png" class="reward-img" alt="支付宝打赏二维码">
                    </div>
                    <div id="wechat">
                        <img src="./medias/loading1.gif" data-original="/gitee.io/medias/reward/wechat.png" class="reward-img" alt="微信打赏二维码">
                    </div>
                </div>
            </div>
        </div>
    </div>
</div>

<script>
    $(function () {
        $('.tabs').tabs();
    });
</script>

            
        </div>
    </div>

    

    

    

    

    

    

    

    

    

    

<article id="prenext-posts" class="prev-next articles">
    <div class="row article-row">
        
        <div class="article col s12 m6" data-aos="fade-up">
            <div class="article-badge left-badge text-color">
                <i class="fas fa-chevron-left"></i>&nbsp;上一篇</div>
            <div class="card">
                <a href="/gitee.io/2022/04/05/chu-shi-shen-jing-wang-luo/">
                    <div class="card-image">
                        
                        <img src="./medias/loading1.gif" data-original="https://cdn.jsdelivr.net/gh/LiU-YU-HANG/blogpic@main/test1/202303031442619.png" class="responsive-img" alt="初始神经网络">
                        
                        <span class="card-title">初始神经网络</span>
                    </div>
                </a>
                <div class="card-content article-content">
                    <div class="summary block-with-text">
                        
                            说到深度学习，不可避免得会提及业界有哪些优秀的框架，Keras神经网络框架便是其中之一，它是一个高级神经网络APl，用Python编写，能够在TensorFlow，CNTK或Theano之上运行。它的开发重点是实现快速实验。能够以最小的延迟从理念到结果是进行良好研究的关键。接下来我们将要讲的神经网络原理与梯度求解，Keras都已经对它们有了很好的封装，在后续的学习中，大家只要学会怎么去构建网络结构就没有什么问题了，其余的问题都由神经网络框架替我们去解决。
                        
                    </div>
                    <div class="publish-info">
                        <span class="publish-date">
                            <i class="far fa-clock fa-fw icon-date"></i>2022-04-05
                        </span>
                        <span class="publish-author">
                            
                            <i class="fas fa-bookmark fa-fw icon-category"></i>
                            
                            <a href="/gitee.io/categories/keras%E5%BF%AB%E9%80%9F%E6%90%AD%E5%BB%BA%E7%A5%9E%E7%BB%8F%E7%BD%91%E7%BB%9C/" class="post-category">
                                    keras快速搭建神经网络
                                </a>
                            
                            
                        </span>
                    </div>
                </div>
                
                <div class="card-action article-tags">
                    
                    <a href="/gitee.io/tags/keras/">
                        <span class="chip bg-color">keras</span>
                    </a>
                    
                    <a href="/gitee.io/tags/python/">
                        <span class="chip bg-color">python</span>
                    </a>
                    
                </div>
                
            </div>
        </div>
        
        
        <div class="article col s12 m6" data-aos="fade-up">
            <div class="article-badge right-badge text-color">
                下一篇&nbsp;<i class="fas fa-chevron-right"></i>
            </div>
            <div class="card">
                <a href="/gitee.io/2022/04/05/ji-qi-xue-xi-ru-men/">
                    <div class="card-image">
                        
                        <img src="./medias/loading1.gif" data-original="https://cdn.jsdelivr.net/gh/LiU-YU-HANG/blogpic@main/test1/202303031442619.png" class="responsive-img" alt="机器学习入门">
                        
                        <span class="card-title">机器学习入门</span>
                    </div>
                </a>
                <div class="card-content article-content">
                    <div class="summary block-with-text">
                        
                            说到深度学习，不可避免得会提及业界有哪些优秀的框架，Keras神经网络框架便是其中之一，它是一个高级神经网络APl，用Python编写，能够在TensorFlow，CNTK或Theano之上运行。它的开发重点是实现快速实验。能够以最小的延迟从理念到结果是进行良好研究的关键。接下来我们将要讲的神经网络原理与梯度求解，Keras都已经对它们有了很好的封装，在后续的学习中，大家只要学会怎么去构建网络结构就没有什么问题了，其余的问题都由神经网络框架替我们去解决。
                        
                    </div>
                    <div class="publish-info">
                            <span class="publish-date">
                                <i class="far fa-clock fa-fw icon-date"></i>2022-04-05
                            </span>
                        <span class="publish-author">
                            
                            <i class="fas fa-bookmark fa-fw icon-category"></i>
                            
                            <a href="/gitee.io/categories/keras%E5%BF%AB%E9%80%9F%E6%90%AD%E5%BB%BA%E7%A5%9E%E7%BB%8F%E7%BD%91%E7%BB%9C/" class="post-category">
                                    keras快速搭建神经网络
                                </a>
                            
                            
                        </span>
                    </div>
                </div>
                
                <div class="card-action article-tags">
                    
                    <a href="/gitee.io/tags/keras/">
                        <span class="chip bg-color">keras</span>
                    </a>
                    
                    <a href="/gitee.io/tags/python/">
                        <span class="chip bg-color">python</span>
                    </a>
                    
                </div>
                
            </div>
        </div>
        
    </div>
</article>

</div>



<!-- 代码块功能依赖 -->
<script type="text/javascript" src="/gitee.io/libs/codeBlock/codeBlockFuction.js"></script>

<!-- 代码语言 -->

<script type="text/javascript" src="/gitee.io/libs/codeBlock/codeLang.js"></script>


<!-- 代码块复制 -->

<script type="text/javascript" src="/gitee.io/libs/codeBlock/codeCopy.js"></script>


<!-- 代码块收缩 -->

<script type="text/javascript" src="/gitee.io/libs/codeBlock/codeShrink.js"></script>


    </div>
    <div id="toc-aside" class="expanded col l3 hide-on-med-and-down">
        <div class="toc-widget card" style="background-color: white;">
            <div class="toc-title"><i class="far fa-list-alt"></i>&nbsp;&nbsp;目录</div>
            <div id="toc-content"></div>
        </div>
    </div>
</div>

<!-- TOC 悬浮按钮. -->

<div id="floating-toc-btn" class="hide-on-med-and-down">
    <a class="btn-floating btn-large bg-color">
        <i class="fas fa-list-ul"></i>
    </a>
</div>


<script src="/gitee.io/libs/tocbot/tocbot.min.js"></script>
<script>
    $(function () {
        tocbot.init({
            tocSelector: '#toc-content',
            contentSelector: '#articleContent',
            headingsOffset: -($(window).height() * 0.4 - 45),
            collapseDepth: Number('0'),
            headingSelector: 'h2, h3, h4'
        });

        // Set scroll toc fixed.
        let tocHeight = parseInt($(window).height() * 0.4 - 64);
        let $tocWidget = $('.toc-widget');
        $(window).scroll(function () {
            let scroll = $(window).scrollTop();
            /* add post toc fixed. */
            if (scroll > tocHeight) {
                $tocWidget.addClass('toc-fixed');
            } else {
                $tocWidget.removeClass('toc-fixed');
            }
        });

        
        /* 修复文章卡片 div 的宽度. */
        let fixPostCardWidth = function (srcId, targetId) {
            let srcDiv = $('#' + srcId);
            if (srcDiv.length === 0) {
                return;
            }

            let w = srcDiv.width();
            if (w >= 450) {
                w = w + 21;
            } else if (w >= 350 && w < 450) {
                w = w + 18;
            } else if (w >= 300 && w < 350) {
                w = w + 16;
            } else {
                w = w + 14;
            }
            $('#' + targetId).width(w);
        };

        // 切换TOC目录展开收缩的相关操作.
        const expandedClass = 'expanded';
        let $tocAside = $('#toc-aside');
        let $mainContent = $('#main-content');
        $('#floating-toc-btn .btn-floating').click(function () {
            if ($tocAside.hasClass(expandedClass)) {
                $tocAside.removeClass(expandedClass).hide();
                $mainContent.removeClass('l9');
            } else {
                $tocAside.addClass(expandedClass).show();
                $mainContent.addClass('l9');
            }
            fixPostCardWidth('artDetail', 'prenext-posts');
        });
        
    });
</script>

    

</main>




    <footer class="page-footer bg-color">
    

    <div class="container row center-align"
         style="margin-bottom: 0px !important;">
        <div class="col s12 m8 l8 copy-right">
            Copyright&nbsp;&copy;
            
                <span id="year">2022-2023</span>
            
            <a href="/gitee.io/about" target="_blank">YuHang Liu</a>
            |&nbsp;Powered by&nbsp;<a href="https://hexo.io/" target="_blank">Hexo</a>
            |&nbsp;Theme&nbsp;<a href="https://github.com/blinkfox/hexo-theme-matery" target="_blank">Matery</a>
            <br>
            
            
            
                
            
            
                <span id="busuanzi_container_site_pv">
                &nbsp;|&nbsp;<i class="far fa-eye"></i>&nbsp;总访问量:&nbsp;
                    <span id="busuanzi_value_site_pv" class="white-color"></span>
            </span>
            
            
                <span id="busuanzi_container_site_uv">
                &nbsp;|&nbsp;<i class="fas fa-users"></i>&nbsp;总访问人数:&nbsp;
                    <span id="busuanzi_value_site_uv" class="white-color"></span>
            </span>
            
            <br>

            <!-- 运行天数提醒. -->
            
            <br>
            
        </div>
        <div class="col s12 m4 l4 social-link social-statis">
    <a href="https://gitee.com/lyhcyt_admin" class="tooltipped" target="_blank" data-tooltip="访问我的Gitee" data-position="top" data-delay="50">
        <i class="fab fa-github"></i>
    </a>



    <a href="mailto:1848450436@qq.com" class="tooltipped" target="_blank" data-tooltip="邮件联系我" data-position="top" data-delay="50">
        <i class="fas fa-envelope-open"></i>
    </a>







    <a href="tencent://AddContact/?fromId=50&fromSubId=1&subcmd=all&uin=1848450436" class="tooltipped" target="_blank" data-tooltip="QQ联系我: 1848450436" data-position="top" data-delay="50">
        <i class="fab fa-qq"></i>
    </a>







</div>
    </div>
</footer>

<div class="progress-bar"></div>


    <!-- 搜索遮罩框 -->
<div id="searchModal" class="modal">
    <div class="modal-content">
        <div class="search-header">
            <span class="title"><i class="fas fa-search"></i>&nbsp;&nbsp;搜索</span>
            <input type="search" id="searchInput" name="s" placeholder="请输入搜索的关键字"
                   class="search-input">
        </div>
        <div id="searchResult"></div>
    </div>
</div>

<script type="text/javascript">
$(function () {
    var searchFunc = function (path, search_id, content_id) {
        'use strict';
        $.ajax({
            url: path,
            dataType: "xml",
            success: function (xmlResponse) {
                // get the contents from search data
                var datas = $("entry", xmlResponse).map(function () {
                    return {
                        title: $("title", this).text(),
                        content: $("content", this).text(),
                        url: $("url", this).text()
                    };
                }).get();
                var $input = document.getElementById(search_id);
                var $resultContent = document.getElementById(content_id);
                $input.addEventListener('input', function () {
                    var str = '<ul class=\"search-result-list\">';
                    var keywords = this.value.trim().toLowerCase().split(/[\s\-]+/);
                    $resultContent.innerHTML = "";
                    if (this.value.trim().length <= 0) {
                        return;
                    }
                    // perform local searching
                    datas.forEach(function (data) {
                        var isMatch = true;
                        var data_title = data.title.trim().toLowerCase();
                        var data_content = data.content.trim().replace(/<[^>]+>/g, "").toLowerCase();
                        var data_url = data.url;
                        data_url = data_url.indexOf('/') === 0 ? data.url : '/' + data_url;
                        var index_title = -1;
                        var index_content = -1;
                        var first_occur = -1;
                        // only match artiles with not empty titles and contents
                        if (data_title !== '' && data_content !== '') {
                            keywords.forEach(function (keyword, i) {
                                index_title = data_title.indexOf(keyword);
                                index_content = data_content.indexOf(keyword);
                                if (index_title < 0 && index_content < 0) {
                                    isMatch = false;
                                } else {
                                    if (index_content < 0) {
                                        index_content = 0;
                                    }
                                    if (i === 0) {
                                        first_occur = index_content;
                                    }
                                }
                            });
                        }
                        // show search results
                        if (isMatch) {
                            str += "<li><a href='" + data_url + "' class='search-result-title'>" + data_title + "</a>";
                            var content = data.content.trim().replace(/<[^>]+>/g, "");
                            if (first_occur >= 0) {
                                // cut out 100 characters
                                var start = first_occur - 20;
                                var end = first_occur + 80;
                                if (start < 0) {
                                    start = 0;
                                }
                                if (start === 0) {
                                    end = 100;
                                }
                                if (end > content.length) {
                                    end = content.length;
                                }
                                var match_content = content.substr(start, end);
                                // highlight all keywords
                                keywords.forEach(function (keyword) {
                                    var regS = new RegExp(keyword, "gi");
                                    match_content = match_content.replace(regS, "<em class=\"search-keyword\">" + keyword + "</em>");
                                });

                                str += "<p class=\"search-result\">" + match_content + "...</p>"
                            }
                            str += "</li>";
                        }
                    });
                    str += "</ul>";
                    $resultContent.innerHTML = str;
                });
            }
        });
    };

    searchFunc('/gitee.io/search.xml', 'searchInput', 'searchResult');
});
</script>

    <!-- 回到顶部按钮 -->
<div id="backTop" class="top-scroll">
    <a class="btn-floating btn-large waves-effect waves-light" href="#!">
        <i class="fas fa-arrow-up"></i>
    </a>
</div>


    <script src="/gitee.io/libs/materialize/materialize.min.js"></script>
    <script src="/gitee.io/libs/masonry/masonry.pkgd.min.js"></script>
    <script src="/gitee.io/libs/aos/aos.js"></script>
    <script src="/gitee.io/libs/scrollprogress/scrollProgress.min.js"></script>
    <script src="/gitee.io/libs/lightGallery/js/lightgallery-all.min.js"></script>
    <script src="/gitee.io/js/matery.js"></script>

    
        <!-- <script src='https://unpkg.com/mermaid@latest/dist/mermaid.min.js'></script> -->
        <script src='/gitee.io/libs/mermaid/mermaid.min.js'></script>
        <script>
          if (window.mermaid) {
            mermaid.initialize({theme: 'forest'});
          }
        </script>
    

    

    <!-- 雪花特效 -->
    

    <!-- 鼠标星星特效 -->
     
        <script type="text/javascript">
            // 只在桌面版网页启用特效
            var windowWidth = $(window).width();
            if (windowWidth > 768) {
                document.write('<script type="text/javascript" src="/gitee.io/libs/others/star.js"><\/script>');
            }
        </script>
    

     
        <script src="https://ssl.captcha.qq.com/TCaptcha.js"></script>
        <script src="/gitee.io/libs/others/TencentCaptcha.js"></script>
        <button id="TencentCaptcha" data-appid="xxxxxxxxxx" data-cbfn="callback" type="button" hidden></button>
    

    <!-- Baidu Analytics -->

    <!-- Baidu Push -->

<script>
    (function () {
        var bp = document.createElement('script');
        var curProtocol = window.location.protocol.split(':')[0];
        if (curProtocol === 'https') {
            bp.src = 'https://zz.bdstatic.com/linksubmit/push.js';
        } else {
            bp.src = 'http://push.zhanzhang.baidu.com/push.js';
        }
        var s = document.getElementsByTagName("script")[0];
        s.parentNode.insertBefore(bp, s);
    })();
</script>

    
    <script src="/gitee.io/libs/others/clicklove.js" async="async"></script>
    
    
    <script async src="/gitee.io/libs/others/busuanzi.pure.mini.js"></script>
    

    

    

    <!--腾讯兔小巢-->
    
    

    

    

    
    <script src="/gitee.io/libs/instantpage/instantpage.js" type="module"></script>
    


        <style>
            [bg-lazy] {
                background-image: none !important;
                background-color: #eee !important;
            }
        </style>
        <script>
            window.imageLazyLoadSetting = {
                isSPA: false,
                preloadRatio: 1,
                processImages: null,
            };
        </script><script>window.addEventListener("load",function(){var t=/\.(gif|jpg|jpeg|tiff|png)$/i,r=/^data:image\/[a-z]+;base64,/;Array.prototype.slice.call(document.querySelectorAll("img[data-original]")).forEach(function(a){var e=a.parentNode;"A"===e.tagName&&(e.href.match(t)||e.href.match(r))&&(e.href=a.dataset.original)})});</script><script>!function(r){r.imageLazyLoadSetting.processImages=t;var e=r.imageLazyLoadSetting.isSPA,n=r.imageLazyLoadSetting.preloadRatio||1,c=a();function a(){var t=Array.prototype.slice.call(document.querySelectorAll("img[data-original]")),e=Array.prototype.slice.call(document.querySelectorAll("[bg-lazy]"));return t.concat(e)}function t(){e&&(c=a());for(var t,o=0;o<c.length;o++)0<=(t=(t=c[o]).getBoundingClientRect()).bottom&&0<=t.left&&t.top<=(r.innerHeight*n||document.documentElement.clientHeight*n)&&function(){var t,e,n,a,i=c[o];e=function(){c=c.filter(function(t){return i!==t}),r.imageLazyLoadSetting.onImageLoaded&&r.imageLazyLoadSetting.onImageLoaded(i)},(t=i).hasAttribute("bg-lazy")?(t.removeAttribute("bg-lazy"),e&&e()):(n=new Image,a=t.getAttribute("data-original"),n.onload=function(){t.src=a,t.removeAttribute("data-original"),e&&e()},t.src!==a&&(n.src=a))}()}function i(){clearTimeout(t.tId),t.tId=setTimeout(t,500)}t(),document.addEventListener("scroll",i),r.addEventListener("resize",i),r.addEventListener("orientationchange",i)}(this);</script></body>

</html>
